import WebOffice from '@/components/WebOffice/index.vue'
export default {
  components: {
    WebOffice
  },
  props: {
    options: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      WebOfficeBool: false,
      WebOfficeInfo: {
        title: ''
      },
      dialogOptions: { // 弹框配置
        visible: true, // 是否显示
        showclose: false
      }
    }
  },
  created() {
    // console.log(this.$store.getters.WebOfficeFile)
    // console.log(this.options.filepath)
    this.initTips()
  },
  methods: {
    initTips: function() {
      if (this.$store.getters.WebOfficeBool) {
        this.dialogOptions.visible = true
      } else {
        this.dialogOptions.visible = false
      }
      this.WebOfficeBool = this.$store.getters.WebOfficeBool
      this.WebOfficeInfo = this.$store.getters.WebOfficeInfo
    },
    closeDialog: function() {
      this.$store.dispatch('WebOffice/setBool', false).then(response => {
        this.dialogOptions.visible = false
      })
    },
    closeDialogd: function() {
      this.WebOfficeBool = this.$store.getters.WebOfficeBool
    }
  }
}
